import Vue from 'vue'

import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		abc: 1,
		innerAudioContext: uni.createInnerAudioContext()
		
	},
	mutations: {
		getChange (state, val) {
			state.innerAudioContext.autoplay = true; // 自动播放
			state.innerAudioContext.src = 'http://m701.music.126.net/20221216163457/e59582161f9825440e63fb342b1078eb/jdyyaac/obj/w5rDlsOJwrLDjj7CmsOj/14096412004/9fa2/d449/33b6/f88ff9ed4a6ef5a3a12faadcfd632b30.m4a';
			state.innerAudioContext.onPlay(() => {
			  console.log('开始播放');
			  // state.abc++
			});
			state.innerAudioContext.onPause(() => {
			  console.log('停止');
			});			
		}
	}
})

export default store